<{include file="admin/header.html"}>
<script type="text/javascript">
function filterp(){
	url = '<{$smarty.const.APPLICATION_URL}>/admin/garage';
	if (document.filter.category_id.value != '')
		url += '/category/' + document.filter.category_id.value;
	if (document.filter.package_id.value != '')
		url += '/package/' + document.filter.package_id.value;
	window.location = url;
}
</script>
<div class="tabs">
    <div class="panel-header-select">
		<label><{#_LB_GARAGE#}></label>
	</div>
</div>
<div class="buttons_action" align="right">
	<button type="button" onClick="filterp()">
	    <img alt="" src="<{$smarty.const.STATIC_COMPONENT_URL}>images/search_16.png"/>
	    <{#_LB_SEARCH#}>
	</button>
	<form name="filter" method="post" action="">
	<table>
		<tr>
			<td><{#_LB_CATEGORY_NAME#}>: </td>
			<td>
				<select name="category_id">
					<option value="">-- choose category --</option>
					<{while $category->fetch()}>
					<option value="<{$category->id}>" <{if $category->id == $category_id}>selected<{/if}> ><{$category->name}></option>
					<{/while}>
				</select>
			</td>
			<td width="10"></td>
			<td><{#_LB_PACKAGE_NAME#}>: </td>
			<td>
				<select name="package_id">
					<option value="">-- choose package --</option>
					<{while $package->fetch()}>
					<option value="<{$package->id}>" <{if $package->id == $package_id}>selected<{/if}> ><{$package->name}></option>
					<{/while}>
				</select>
			</td>
			<td width="20"></td>
		</tr>
	</table>
	</form>
</div>
<br>

<table class="grid">				
	<tr class="head">
        <td width="10%"><{#_LB_GARAGEHOLDER_ID#}></td>	
		<td width="20%"><{#_LB_GARAGEHOLDER_TITLE#}></td>	
		<td width="20%"><{#_LB_GARAGEHOLDER_M2#}></td>
		<td width="20%"><{#_LB_GARAGEHOLDER_METER#}></td>
		<td width="20%"><{#_LB_GARAGEHOLDER_SPOT#}></td>
		<td width="20%"><{#_LB_GARAGEHOLDER_ADDRESS#}></td>
		<td width="20%"><{#_LB_GARAGEHOLDER_CATEGORY#}></td>
		<td width="20%"><{#_LB_GARAGEHOLDER_PACKAGE#}></td>
		<td width="20%"><{#_LB_GARAGEHOLDER_AD#}></td>
		<td width="10%"><{#_LB_FUNCTION#}></td>				
	</tr>
	<{while $garage->fetch()}>
		<tr>
            <td><{$garage->id}></td>
			<td><{$garage->title}></td>
			<td><{$garage->m2}></td>
			<td><{$garage->meter}></td>
			<td><{$garage->spot}></td>
			<td><{$garage->address}></td>
			<td><{$garage->category_name}></td>
			<td><{$garage->package_name}></td>
			<td><{$garage->ad_name}></td>
			<td>
				<a href="<{$smarty.const.APPLICATION_URL}>/admin/garage/action/view/id/<{$garage->id}>" title="edit" >
					<img border=0 alt="edit_small.png" src="<{$smarty.const.STATIC_COMPONENT_URL}>images/view-detail-icon.png"/>						
				</a>		
				
				<a onclick="return confirm('<{#_LB_DELETE_CONFIRM#}>')" href="<{$smarty.const.APPLICATION_URL}>/admin/garage/action/delete/id/<{$garage->id}>" title="delete" >
					<img border=0 alt="delete_small.png" src="<{$smarty.const.STATIC_COMPONENT_URL}>images/delete_small.png"/>						
				</a>		
			</td>
		</tr>
	<{/while}>	
</table>	

<div align="right">
	<{include file='pager.html' data=$garage->getPaginationData() url_base=$url_base}>
</div>


<{include file="admin/footer.html"}>